<?php

namespace App\Listeners;

use App\Events\GoldRecordPaidEvent;
use App\Services\RewardGoldPrize\RewardFirstParentCash;

class GoldRecordPaidListener
{
    public function handle(GoldRecordPaidEvent $event)
    {
    	$record = $event->goldRecord;

        $user = $record->user;

    	$user->markRecordCacheAsPaid($record);

        app(RewardFirstParentCash::class, ['record' => $record])->reward();

	    user_upgrade($record->user);
    }
}
